package week12;

import java.io.*;
import java.util.Random;
public class GenNumber {
    public static void main(String[] args)
    {
        String filepath = System.getProperty("user.dir");
        filepath +="\\20165215.txt";
        System.out.println(filepath);
        try {
            File file = new File(filepath);
            if(!file.exists())
            {
                file.createNewFile();
                System.out.println("data.txt创建完成");
            }
            FileWriter fw = new FileWriter(file);
            BufferedWriter bw = new BufferedWriter(fw);
            Random random = new Random();
            for(int i = 0; i<215; i++)
            { int randint =(int)Math.floor((random.nextDouble()*20165215.0));
                bw.write(String.valueOf(randint));
                bw.newLine();
            }
            bw.close();
            fw.close(); } catch (IOException e) {
        }
        catch (Exception e) { e.printStackTrace(); } } }